<template>
  <div class="bg-w">
    <div class="box container" v-if="peopleData">
      <div class="right">
        <build-el-head
          :url="peopleData.titleImg"
          :com="peopleData.artistPosition"
          :position="'182-xxxx-xxxx'"
          :name="peopleData.artistName"
          :rid="peopleData.recordId"
        ></build-el-head>
        <!-- <p class="w100 dep">{{peopleData.description}}</p> -->
      </div>
      <!-- <build-el-bread :text="peopleData&&peopleData.artistName"></build-el-bread> -->
      <div class="container al-start j-sb">
        <div class="left">
          <div class="w100">
            <build-el-title-text :title="peopleData.modelName1"></build-el-title-text>
          </div>
          <div v-html="peopleData.modelContent1" v-margin-top="'15px'" />
          <div class="w100" v-margin-top="'40px'">
            <build-el-title-text :title="peopleData.modelName2"></build-el-title-text>
          </div>
          <div v-html="peopleData.modelContent2" v-margin-top="'15px'" />
          <div class="w100" v-margin-top="'40px'">
            <build-el-title-text :title="peopleData.modelName3"></build-el-title-text>
          </div>
          <div v-html="peopleData.modelContent3" v-margin-top="'15px'" />
          <build-el-perview-imgs v-margin-top="'30px'" :imgs="peopleData._artistWorks"></build-el-perview-imgs>
        </div>
      </div>
      <el-button @click="handVote" class="w100" v-margin-top="'20px'" type="primary">投票</el-button>
      <div v-margin-top="'30px'"></div>
    </div>
  </div>
</template>
<script>
import buildElBread from '@/components/build-el-bread'
import buildElTitleText from '@/components/build-el-title-text'
import buildElPerviewImgs from '@/components/build-el-perview-imgs'
import buildElHead from '../components/build-el-head'
import JSONData from '@/assets/JSON'
export default {
  components: {
    buildElBread,
    buildElTitleText,
    buildElPerviewImgs,
    buildElHead,
  },
  data() {
    return {
      ...JSONData,
      peopleData: null,
      id: null,
    }
  },
  async created() {
    this.id = this.$route.query.id
    this.init(this.id)
  },

  methods: {
    async handVote() {
      console.log(this.peopleData)
      let res = await this.api.votePc({
        customizeId: 1,
        artistId: this.peopleData.id,
      })
      this.$message({
        message: res.content,
        type: 'success',
      })
      console.log(res)
    },
    async init(id) {
      let people = await this.api.selectOneArtistPeople(id)
      this.peopleData = people
      console.log(people)
    },
  },
}
</script>
<style lang="less" scoped>
.left {
  // width: 880px;
  background: #ffffff;
  border-radius: 6px;
  border-radius: 6px;
}
.right {
  // width: 300px;
  background: #ffffff;
  padding: 32px 20px;
  border-radius: 6px;
  border-radius: 6px;
  .dep {
    font-size: 14px;
    color: #666666;
    letter-spacing: 0;
    text-align: left;
    margin-top: 20px;
  }
}
</style>
